<script lang="ts" setup>
import { onMounted } from 'vue';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { initWebSocket } from '@/utils/websocket'
import userStore from '@/store'


//连接设备  （具体路径和后端规定）
function connectMsg() {
  const { useWebsocketStore } = userStore()
  const toIp = `ws://localhost:3000/basic`;
  useWebsocketStore().setConnected(true)
  initWebSocket(toIp)
}

onMounted(() => {
  // 判断当前缓存中是否登录，如果处于登录状态，则进行连接
  // connectMsg()
})
</script>

<template>
  <el-config-provider :locale="zhCn">
    <router-view></router-view>
  </el-config-provider>
</template>

<style scoped>
</style>
